package cc.idoone.spring_boot_hello.config;

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Web 基本配置
 *
 * @author hemj
 * @since 2017/10/22
 */
@Configuration
public class WebappConfig {

	/**
	 * Session Timeout 配置
	 */
	@Bean
	public EmbeddedServletContainerCustomizer containerCustomizer(){
		return new EmbeddedServletContainerCustomizer() {
			@Override
			public void customize(ConfigurableEmbeddedServletContainer container) {
				container.setSessionTimeout(1800); //修改会话时间, 单位为秒
			}
		};
	}
}
